package com.edu.exam.entity.classmanagement.administrative;


/**
 * 班级调整状态枚举
 * 管理班级调整流程的状态
 *
 * @author System
 * @version 1.0.0
 */
public enum AdjustmentStatus {

    PENDING("PENDING", "待审批", 1),
    APPROVED("APPROVED", "已批准", 2),
    REJECTED("REJECTED", "已拒绝", 3),
    COMPLETED("COMPLETED", "已完成", 4),
    CANCELLED("CANCELLED", "已取消", 5);

    private final String code;
    private final String description;
    private final int order;

    AdjustmentStatus(String code, String description, int order) {
        this.code = code;
        this.description = description;
        this.order = order;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public int getOrder() {
        return order;
    }

    public static AdjustmentStatus fromCode(String code) {
        if (code == null || code.trim().isEmpty()) {
            return null;
        }

        for (AdjustmentStatus value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}